// 课前预习模块
import React from 'react'
import '../css/fivestep.less';
import http from '../../../utils/http';

class InClass extends React.Component {
  // 初始化加载钩子
  //   updata=setInterval(()=>{
  //   let a=new Date();
  //   let time= a.getTime()
  //   if(this.props.status.classinfo.courseTabVo.endTime<=time){
  //     this.props.countdown()
  //   }else{
  //     return ""
  //   }
  // },1000)

  componentDidMount(){
  }
  componentWillUnmount(){
    clearInterval(this.updata)
  }
  // 调用本地classin
  enterClass= () => { 
    http
        .get('course/enter', {
          params: {
            classId: this.props.status.classinfo.courseTabVo.currentClassId
          }
        })
        .then(data => {
          window.location.href=data
        }, err => {
    })
  }

  render () {
    return (
        <div className="delposition">
          <div className="fivestep">
             <div className="novicetsakbg havephone">
                <p className= {(this.props.status18==="T"?"testbiaoqian":(this.props.status18==="R"?"priviewbiaoqian":"normalbiaoqian"))+" coursesSort teacherpho"}>
                  {this.props.status18==="T"?"体验课":(this.props.status18==="R"?"复习课":this.props.status.classinfo.courseTabVo.tabName)}
                </p>
                <div className="teacherphone">
                  <div className="tel-show" style={{padding:0,display:"inline-block"}}>
                  <img className="normal" alt='' src={require('../../../images/icon/tel_normal.png')}/>
                  <img className="hover" alt='' src={require('../../../images/icon/tel_hover.png')}/>
                  {/* 电话图片显示 */}
                    <div className="place-bottom" style={{backgroundImage: `url(${require('../../../images/main/tel.png')})`,right:"10px",top:"48px"}}>{this.props.status.classinfo.courseTabVo.headmasterVo.userName+"  " +this.props.status.classinfo.courseTabVo.headmasterVo.mobile}</div> 
                  </div>
              </div>
              </div>
              <p className="pretime classing">
                正在上课
              </p>
              <div className="midlehr"></div>

              {/* <p className="countDown" >课程状态</p> */}
              <ul >
                <li className="lesson">{this.props.status.classinfo.courseTabVo.className}</li>
                <li className="reader">{this.props.status.classinfo.courseTabVo.englishName}</li>
                <li className="translate">{this.props.status.classinfo.courseTabVo.chineseName}</li>
              </ul>
              <a target="_blank" href={this.props.status.classinfo.courseTabVo.classinVideo} type="button" className={(this.props.status18==="T"?"Experiencebutton":(this.props.status18==="R"?"reviewbutton":"Regularclassbutton"))+"  btn btn-primary enterclass"} >进入课堂</a>
          </div>
        </div>
    )
  }
}
export default InClass